//接口层

//引入axios,js
import axios from '@/utils/axios.js';

//登录页面接口
export const Login = (data) => {
    return axios({
        url: '/users/checkLogin', //请求地址
        method: 'post', //请求方式
        data
    })
}

//检查账号是否重复
export const reqAccRepeat = (data) => {
    return axios({
        url: '/users/repeat',
        method: 'post',
        data
    })
}

//添加账号页面接口
export const reqAddAcc = (data) => {
    return axios({
        url: '/users/add', //请求地址
        method: 'post', //请求方式
        data
    })
}

//账号列表页面接口
// 获取账号列表
export const reqAccList = (params) => {
        return axios({
            url: '/users/list', //请求地址
            method: 'get', //请求方式
            params
        })
    }
    // 删除账号接口
export const reqAccDel = (params) => {
    return axios({
        url: '/users/del', //请求地址
        method: 'get', //请求方式
        params
    })
}

// 批量删除账号接口
export const reqAccBatchDel = (data) => {
    return axios({
        url: '/users/batchdel', //请求地址
        method: 'post', //请求方式
        data
    })
}

// 修改账号
export const reqEditAcc = (data) => {
    return axios({
        url: '/users/edit',
        method: 'post',
        data
    })
}

//修改密码
export const reqEditPass = (data) => {
    return axios({
        url: '/users/editpwd',
        method: 'post',
        data
    })
}

//检查旧密码是否正确
export const reqCheckOld = (params) => {
    return axios({
        url: '/users/checkoldpwd',
        method: 'get',
        params
    })
}

//获取账号信息
export const reqGetUserInfo = (params) => {
    return axios({
        url: '/users/info',
        method: 'get',
        params
    })
}

//修改用户图像
export const reqUploadAvatar = (params) => {
    return axios({
        url: '/users/avataredit',
        method: 'get',
        params
    })
}